package Bio::Rambam::Proteomics::Engines;
use Moose;
use namespace::autoclean;
use Bio::Rambam::Proteomics qw($SEARCHES_DATA);
use Try::Tiny;
use Data::Dumper;
use File::Basename;
use File::Temp qw/tempdir/;
use Cwd;
my $location= Cwd::abs_path(__FILE__);
$location=(fileparse($location))[1];

has 'omssa'		=>	(is=>'rw',	isa=>'Str',	 	predicate => 'has_omssa'	);
has 'xtandem'	=>	(is=>'rw',	isa=>'Str', 	predicate => 'has_xtandem'	);
has 'comet'		=>	(is=>'rw',	isa=>'Str', 	predicate => 'has_comet'	);
has 'myrimatch'	=>	(is=>'rw',	isa=>'Str', 	predicate => 'has_myrimatch');
has 'msgfplus'	=>	(is=>'rw',	isa=>'Str',		predicate => 'has_msgfplus'	);


sub BUILD {
	my $self = shift;
	my $output_folder=tempdir( CLEANUP => 1 );
	my $fastatest_location=$location."Tools/Searches/testDB.fasta";
	my $input_file=$location."Tools/Searches/test.mgf";
	my $search=Bio::Rambam::Proteomics::Search->new(
												folder	 		=> 	$output_folder,
												input_file		=> 	$input_file,
												engines	 		=> 	$self,
												database 		=> 	$fastatest_location,
												enzyme	 		=> 	'Trypsin',
												fixed_mods		=>	'4@C,214@Nt',
												variable_mods	=>	'35@M,214@Y',
												miss_cleavages	=>	 2,
												fragmentation	=>	'ECD',	
											);
	my $str;
	open my $fh, '>', \$str;
	{
  		local *STDOUT = $fh;
  		$search->exec();
	}
	#print $str;
}







__PACKAGE__->meta->make_immutable;